<template>
	<view class="paper-tab f-ac" @tap="toSpeak">
		<view class="p-l">
			<image :src="contact.logo" mode="scaleToFill"></image>
		</view>
		<view class="f-jsb p-content">
			<view class="p-c">
				<view class="p-c-name">{{contact.uname}}</view>
				<view class="p-c-lm">{{contact.lastMsg}}</view>
			</view>
			<view class="p-r">
				<view class="p-r-time">{{contact.lastMsgTime.format("hh:mm")}}</view>
				<view v-show="contact.unreadNum > 0" class="p-r-num f-ajc">{{contact.unreadNum}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				
			}
		},
		props:{
			contact : Object
		},
		methods:{
			toSpeak(){
				uni.navigateTo({
					url: '../../pages/speak/speak',
				});
			}
		}
	}
</script>

<style scoped>
	
	.p-l > image {
		height: 120rpx;
		width: 120rpx;
		border-radius: 100%;
		margin-left: 10rpx;
		margin-top: 10rpx;
	}
	
	.paper-tab {
		margin: 10rpx;
		border-bottom: 1rpx solid rgba(1,2,1,.1);
	}
	
	.p-c {
		margin-left:  20rpx;
	}
	.p-c-name {
		font-size: 32rpx;
		font-weight: 700;
	}
	.p-c-lm {
		color: #CDCCCD;
		font-size: 26rpx;
		
	}
	
	.p-r {
		margin-right: 20rpx;
	}
	.p-r-time {
		color: #AAAAAA;
	}
	

	
	
	.p-content {
		width: 100%;
	}
	
	.p-content > view {
		display: flex;
		flex-direction: column;
	}
	.p-r {
		justify-items: center;
		align-items: center;
	}
	.p-c > view{
		flex: 1;
	}
	.p-r > .p-r-time {
		flex: 1;
		display: flex;
		align-items: center;
		font-size: 24rpx;
	}
	
	.p-r > .p-r-num {
		padding: 0 10rpx;
		border-radius: 50rpx;
		color: #FFFFFF;
		background-color: #FF7038;
		font-size: 20rpx;
	}
</style>
